package LinkedList集合特有功能;

import java.util.LinkedList;

public class LinkedListDemo {
    public static void main(String[] args) {
        LinkedList<String> linkedList = new LinkedList<String>();
        linkedList.add("hello");
        linkedList.add("world");
        linkedList.add("java");

        System.out.println(linkedList.getFirst());
        System.out.println(linkedList.getLast());
        linkedList.addFirst("javaee");
        linkedList.addLast("sss");
        System.out.println(linkedList);
        //增强for遍历数组
        for (String s : linkedList) {
            System.out.println(s);
        }
    }}
